<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use EloquentFilter\Filterable;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\Traits\Admin\ActionButtonTrait;
class Orders extends Model
{
    //

    use Filterable,SoftDeletes, ActionButtonTrait;

    protected $fillable = [
        'user_id','goodsid','deleted_at','fault','freight_status','couter_id','ordersn','ordersnp','machines_imel', 'machines_name','freightway_id','freightway_name','goods_total_price','order_total_price','payment','order_status','refund_status','refund_status','payment_time'
    ];

    protected $append = ['actionButton'];

    protected $actions = ['refund'];

    protected $actionUri = 'orders';
    public function goods()
    {
    	return $this->belongsTo(Goods::class, 'goodsid', 'id');
    }

    public function order_merchant()
    {
     return $this->hasOne(MerchantOrder::class, 'order_id', 'id');
    }

}
